package com.sgsg.memomodule;

import android.os.Looper;
import android.util.Log;

public class PlayRole {

    private int vit;
    private int atk;
    private int def;

    public int getVit() {
        return vit;
    }

    public void setVit(int vit) {
        this.vit = vit;
    }

    public int getAtk() {
        return atk;
    }

    public void setAtk(int atk) {
        this.atk = atk;
    }

    public int getDef() {
        return def;
    }

    public void setDef(int def) {
        this.def = def;
    }

    public void getInitState(){
        this.vit=100;
        this.atk=100;
        this.def=100;
    }

    public void stateDisplay(){
        Log.i("tag","角色当前状态为：");
        Log.i("tag","生命力："+vit);
        Log.i("tag","攻击力："+atk);
        Log.i("tag","防御力："+def);
    }

    public RoleStateMemento saveState(){
        return new RoleStateMemento(vit,atk,def);
    }

    public void recoveryState(RoleStateMemento memento){
        this.vit=memento.getVit();
        this.atk=memento.getAtk();
        this.def=memento.getDef();
    }

    public void fight() {
        this.vit=0;
        this.atk=0;
        this.def=0;
    }
}
